package net.sky.oa.test;

import java.util.HashMap;

import org.apache.struts2.ServletActionContext;
import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;

import com.opensymphony.xwork2.ActionContext;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:conf/sky/app-test-context.xml" })
@TransactionConfiguration(transactionManager = "txManagerSky", defaultRollback = false)
@Transactional
public class BaseActionTestCase {
	protected MockHttpServletRequest request;
	protected MockHttpServletResponse response;

	@Before
	public void setUp() {
		request = new MockHttpServletRequest();
		response = new MockHttpServletResponse();

		ActionContext.setContext(new ActionContext(new HashMap()));

		ServletActionContext.setRequest(request);
		ServletActionContext.setResponse(response);
	}

	@After
	public void tearDown() {
		//org.easymock.classextension.EasyMock.verify(sysSchoolAction);
	}

	@Rollback(false)
	//@Test
	public void test() {
		System.out.println("Hello!");
	}
}
